/* 导入全局样式 */
@import url('./common/header.css');

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --text-color: #333;
    --border-color: #dee2e6;
    --background-color: #f0f0f0;
    --white: #fff;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --spacing: 20px;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.register-container {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 350px;
}

.register-container h2 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
}

.form-group.has-error input {
    border-color: var(--danger-color);
}

.form-group .error-text {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-group.has-error .error-text {
    display: block;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.submit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
    background-color: var(--primary-color);
    color: var(--white);
}

.submit-btn:hover {
    background-color: #0056b3;
}

.login-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.error-message {
    color: var(--danger-color);
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: none;
}

.success-message {
    color: var(--success-color);
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: none;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .register-container {
        width: 90%;
        margin: 20px;
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .submit-btn {
        width: 100%;
    }
}
